package maksb.logger;

import java.io.FileWriter;
import java.io.IOException;


public class FileAppender {
    FileWriter writer;

    public FileAppender(String fileName) {
        try {
            writer = new FileWriter(fileName);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public synchronized void append(String str) {
        if (writer != null) {
            try {
                writer.append(str);
                writer.flush();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

}
